<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Cherry Editor - Markdown Editor</title>
    <style>
      html,
      body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: hidden;
      }

      video {
        max-width: 400px;
      }

      #demo-val {
        display: none;
      }

      img {
        max-width: 100%;
      }
      iframe.cherry-dialog-iframe {
        width: 100%;
        height: 100%;
      }
    </style>
    <link rel="stylesheet" type="text/css" href="../packages/cherry-markdown/dist/cherry-markdown.css" />
    <link rel="Shortcut Icon" href="./logo/favicon.ico" />
    <link rel="Shortcut Icon" href="../logo/favicon.ico" />
    <link rel="Bookmark" href="../logo/favicon.ico" />
    <!-- <link href="./assets/markdown/index.md" rel="preload" /> -->
  </head>

  <body>
    <div id="dom_mask" style="position: absolute; top: 40px; height: 20px; width: 100%"></div>
    <div id="markdown"></div>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
    <script
      src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"
      integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4"
      crossorigin="anonymous"
    ></script>
    <script src="../packages/cherry-markdown/dist/cherry-markdown.js"></script>
    <script src="./assets/scripts/pinyin/pinyin_dist.js"></script>
    <script type="module">
      // 使用 fetch 获取 markdown 文件内容
      const response = await fetch('./assets/markdown/index.md');
      const basicMd = await response.text();
      import { basicConfig } from './assets/scripts/index-demo.js';
      // 在Vite中使用?raw导入的文件内容已经是字符串，无需通过fetch获取
      const config = Object.assign({}, basicConfig, { value: basicMd });
      window.cherry = new Cherry(config);
    </script>
  </body>
</html>
